package com.kc.business.enums;

import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * FileName: ShareDistributionApplyAuditStatusEnum
 * Author:   TP
 * Date:     2020-11-14 09:05
 * Description: 分销用户审核状态
 */
@Getter
public enum ShareDistributionApplyAuditStatusEnum {

    AUDITING(0, "审核中"),
    AUDIT_PASS(1, "审核通过"),
    AUDIT_REJECT(2, "审核拒绝");

    private Integer value;
    private String desc;

    ShareDistributionApplyAuditStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static List<Integer> getAllStatus() {
        ShareDistributionApplyAuditStatusEnum[] enums = ShareDistributionApplyAuditStatusEnum.values();
        List<Integer> result = new ArrayList<>(3);
        for (ShareDistributionApplyAuditStatusEnum thisEnum : enums) {
            result.add(thisEnum.getValue());
        }
        return result;
    }

    public static String getDesc(Integer status) {
        ShareDistributionApplyAuditStatusEnum[] enums = ShareDistributionApplyAuditStatusEnum.values();
        for (ShareDistributionApplyAuditStatusEnum thisEnum : enums) {
            if (thisEnum.getValue().equals(status)) {
                return thisEnum.getDesc();
            }
        }
        return null;
    }
}
